
target_dir ?= /

OBJS = common.o memory.o
LIB = libanotherc.so

CC = gcc
CFLAGS += -I../include

ifeq ($(DEBUG), y)
CFLAGS += -g -DDEBUG
endif

$(LIB): $(OBJS)
	$(CC) -fPIC -shared -ldl -o $(LIB) $(OBJS)

install:
	mkdir -p $(target_dir)/usr/lib
	install -m -644 $(LIB) $(target_dir)/usr/lib
clean:
	-rm -f *.o *.so
